package com.antdesignbackend.backend.service.impl;

import com.antdesignbackend.backend.entity.City;
import com.antdesignbackend.backend.entity.entityVo.CityVo;
import com.antdesignbackend.backend.mapper.CityMapper;
import com.antdesignbackend.backend.service.CityService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CityServiceImpl extends ServiceImpl<CityMapper, City> implements CityService {
    @Autowired
    private CityMapper cityMapper;

    @Override
    public int count(QueryWrapper<CityVo> wrapper) {
        return cityMapper.count(wrapper);
    }
    @Override
    public List<CityVo> search(@Param(Constants.WRAPPER) QueryWrapper<CityVo> queryWrapper, Page<CityVo> page){
        return cityMapper.search(queryWrapper,page);
    }
}
